<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/**
 * bbclone web log Class
 *
 * 웹로그 관련
 *
 * @package		
 * @subpackage	Libraries
 * @category	Libraries
 * @author		
 * @link
 */

class Bbclone {
	private $access;
	private $BBC_ROOT_PATH;
	private $BBC_VERSION;
	private $BBC_CACHE_PATH;
	private $BBC_CONF_PATH;
	private $BBC_CSS_PATH;
	private $BBC_IMAGES_PATH;
	private $BBC_LANGUAGE_PATH;
	private $BBC_LIB_PATH;
	private $BBC_PLUGIN_PATH;
	private $BBC_IP2EXT_PATH;
	private $BBC_ACCESS_FILE;
	private $BBC_LAST_FILE;
	private $BBC_CONFIG_FILE;
	private $BBC_TIMESTAMP;
	private $BBC_COUNTER_FILES;
	private $BBC_COUNTER_PREFIX;
	private $BBC_COUNTER_SUFFIX;
	private $BBC_LOCK;
	private $BBC_SEP;
	private $BBC_COUNTER_COLUMNS;
	private $BBC_COUNTER_COLUMN_NAMES;
	private $BBC_LOG_PROCESSOR;
	
	function __construct() {		
		// BBClone's location relative from where it's been called
		$this->BBC_ROOT_PATH = defined("_BBCLONE_DIR") ? _BBCLONE_DIR : "";
		// BBClone version
		$this->BBC_VERSION = "0.6.1";
		// Directory paths
		$this->BBC_CACHE_PATH  = $this->BBC_ROOT_PATH."var/";
		$this->BBC_CONF_PATH = $this->BBC_ROOT_PATH."conf/";
		$this->BBC_CSS_PATH = "css/";
		$this->BBC_IMAGES_PATH = "images/";
		$this->BBC_LANGUAGE_PATH = $this->BBC_ROOT_PATH."language/";
		$this->BBC_LIB_PATH = $this->BBC_ROOT_PATH."lib/";
		$this->BBC_PLUGIN_PATH = $this->BBC_LIB_PATH."plugin/";
		$this->BBC_IP2EXT_PATH = $this->BBC_ROOT_PATH."ip2ext/";
		// File paths
		$this->BBC_ACCESS_FILE = $this->BBC_CACHE_PATH."access.php";
		$this->BBC_LAST_FILE = $this->BBC_CACHE_PATH."last.php";
		$this->BBC_CONFIG_FILE = $this->BBC_CONF_PATH."config.php";
		// Timestamp at run-time
		$this->BBC_TIMESTAMP = time();
		// Amount of counter files
		$this->BBC_COUNTER_FILES = 8;
		// Name of the counter files
		$this->BBC_COUNTER_PREFIX = "counter";
		$this->BBC_COUNTER_SUFFIX = ".inc";
		$this->BBC_LOCK = $this->BBC_CACHE_PATH.".htalock";
		// Global separator
		$this->BBC_SEP = chr(173);
		// How many columns they contain
		$this->BBC_COUNTER_COLUMNS = 8;
		// What titles are assigned to them
		$this->BBC_COUNTER_COLUMN_NAMES = array("time", "prx_ip", "ip", "dns", "agent", "referer", "uri", "page");
		// File path Log Processor
		$this->BBC_LOG_PROCESSOR = $this->BBC_ROOT_PATH."log_processor.php";
		
		/*if (is_readable(convert_path("/asset/bbclone/constants.php"))) require_once(convert_path("/asset/bbclone/constants.php"));
		else exit("ERROR: Unable to open constants.php");
		*/
		/*foreach (array($BBC_CONFIG_FILE, $this->BBC_ACCESS_FILE) as $i) {
			if (is_readable(convert_path('/asset/bbclone/'.$i))) require_once(convert_path('/asset/bbclone/'.$i));
			else exit(bbc_msg($i));
		}
		$this->access = $access;*/
	}
	
	function getAsscess(){
		foreach (array($this->BBC_CONFIG_FILE, $this->BBC_ACCESS_FILE) as $i) {
			if (is_readable(convert_path('/asset/bbclone/'.$i))) require_once(convert_path('/asset/bbclone/'.$i));

		}
		$this->access = $access;
		return $this->access;
	}
	
	function setCounter(){
				
	}
	
}
?>